import type { Commit } from 'vuex';

export interface UserState {
  token: string;
  userInfo: any | null;
}

export type UserMutations = {
  SET_TOKEN: (state: UserState, value: string) => void;
  SET_USER: (state: UserState, value: any) => void;
};

export type UserActions = {
  Login: ({ commit }: { commit: Commit }, data: any) => Promise<any>;
  Info: ({ commit, state }: { commit: Commit; state: UserState }) => Promise<any>;
  Logout: ({ commit }: { commit: Commit }, data: any) => Promise<any>;
};

export type UserGetters = {
  getToken: (state: UserState) => string;
  getUserInfo: (state: UserState) => any;
};